package com.travel.JPA;

import com.travel.Bean.Culture;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import java.util.List;
import java.util.Map;

public interface CultureJPA extends JpaRepository<Culture,Integer> {

    @Query("select id from Culture where manager_id = (select id from Manager where username = ?1)")
    List<Integer> findCultureIdByUsername(String username);

    @Modifying
    @Query("delete from Culture where id = ?1")
    Integer deleteByid(Integer id);

    @Query("select id,spot_name,spot_opentime from Culture where spot_name like concat('%',?1,'%')")
    List<Object []> findUserCultureByName(String spot_name);



}
